package com.azusa.xbiao.entity;

import javax.persistence.*;

@Entity
@Table(name = "address")
public class Address {
    private int id;
    private Integer uId;
    private String name;
    private String postcode;
    private String phone;
    private String region;
    private String address;
    private Integer isDefault;
    private Integer display;

    @Id
    @Column(name = "id", table = "address", nullable = false)
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "u_id", table = "address", nullable = true)
    public Integer getuId() {
        return uId;
    }

    public void setuId(Integer uId) {
        this.uId = uId;
    }

    @Basic
    @Column(name = "name", table = "address", nullable = true, length = 255)
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Basic
    @Column(name = "postcode", table = "address", nullable = true, length = 255)
    public String getPostcode() {
        return postcode;
    }

    public void setPostcode(String postcode) {
        this.postcode = postcode;
    }

    @Basic
    @Column(name = "phone", table = "address", nullable = true, length = 255)
    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    @Basic
    @Column(name = "region", table = "address", nullable = true, length = 255)
    public String getRegion() {
        return region;
    }

    public void setRegion(String region) {
        this.region = region;
    }

    @Basic
    @Column(name = "address", table = "address", nullable = true, length = 255)
    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    @Basic
    @Column(name = "is_default", table = "address", nullable = true)
    public Integer getDefault() {
        return isDefault;
    }

    public void setDefault(Integer aDefault) {
        isDefault = aDefault;
    }

    @Basic
    @Column(name = "display", table = "address", nullable = true)
    public Integer getDisplay() {
        return display;
    }

    public void setDisplay(Integer display) {
        this.display = display;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Address address1 = (Address) o;

        if (id != address1.id) return false;
        if (uId != null ? !uId.equals(address1.uId) : address1.uId != null) return false;
        if (name != null ? !name.equals(address1.name) : address1.name != null) return false;
        if (postcode != null ? !postcode.equals(address1.postcode) : address1.postcode != null) return false;
        if (phone != null ? !phone.equals(address1.phone) : address1.phone != null) return false;
        if (region != null ? !region.equals(address1.region) : address1.region != null) return false;
        if (address != null ? !address.equals(address1.address) : address1.address != null) return false;
        if (isDefault != null ? !isDefault.equals(address1.isDefault) : address1.isDefault != null) return false;
        if (display != null ? !display.equals(address1.display) : address1.display != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (uId != null ? uId.hashCode() : 0);
        result = 31 * result + (name != null ? name.hashCode() : 0);
        result = 31 * result + (postcode != null ? postcode.hashCode() : 0);
        result = 31 * result + (phone != null ? phone.hashCode() : 0);
        result = 31 * result + (region != null ? region.hashCode() : 0);
        result = 31 * result + (address != null ? address.hashCode() : 0);
        result = 31 * result + (isDefault != null ? isDefault.hashCode() : 0);
        result = 31 * result + (display != null ? display.hashCode() : 0);
        return result;
    }
}
